
/*
===============================================================================
                    EntitySpaces Studio by EntitySpaces, LLC
             Persistence Layer and Business Objects for Microsoft .NET
             EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC
                          http://www.entityspaces.net
===============================================================================
EntitySpaces Version : 2012.1.0930.0
EntitySpaces Driver  : SQL
Date Generated       : 2016/7/28 0:24:06
===============================================================================
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using System.Data;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using EntitySpaces.Core;
using EntitySpaces.Interfaces;
using EntitySpaces.DynamicQuery;



namespace yncTech.BusinessObjects
{
	/// <summary>
	/// Encapsulates the 'V_ShippingInfo' view
	/// </summary>

    [DebuggerDisplay("Data = {Debug}")]
	[Serializable]
	[DataContract]
	[KnownType(typeof(VShippingInfo))]	
	[XmlType("VShippingInfo")]
	public partial class VShippingInfo : esVShippingInfo
	{	
		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden | DebuggerBrowsableState.Never)]
		protected override esEntityDebuggerView[] Debug
		{
			get { return base.Debug; }
		}

		override public esEntity CreateInstance()
		{
			return new VShippingInfo();
		}
		
		#region Static Quick Access Methods
		
		#endregion

		
					
		
	
	}



    [DebuggerDisplay("Count = {Count}")]
	[Serializable]
	[CollectionDataContract]
	[XmlType("VShippingInfoCollection")]
	public partial class VShippingInfoCollection : esVShippingInfoCollection, IEnumerable<VShippingInfo>
	{

		
		
		#region WCF Service Class
		
		[DataContract]
		[KnownType(typeof(VShippingInfo))]
		public class VShippingInfoCollectionWCFPacket : esCollectionWCFPacket<VShippingInfoCollection>
		{
			public static implicit operator VShippingInfoCollection(VShippingInfoCollectionWCFPacket packet)
			{
				return packet.Collection;
			}

			public static implicit operator VShippingInfoCollectionWCFPacket(VShippingInfoCollection collection)
			{
				return new VShippingInfoCollectionWCFPacket() { Collection = collection };
			}
		}
		
		#endregion
		
				
	}



    [DebuggerDisplay("Query = {Parse()}")]
	[Serializable]	
	public partial class VShippingInfoQuery : esVShippingInfoQuery
	{
		public VShippingInfoQuery():this("VShippingInfoQuery")
		{
		}
		public VShippingInfoQuery(string joinAlias)
		{
			this.es.JoinAlias = joinAlias;
		}	

		override protected string GetQueryName()
		{
			return "VShippingInfoQuery";
		}
		
					
	
		#region Explicit Casts
		
		public static explicit operator string(VShippingInfoQuery query)
		{
			return VShippingInfoQuery.SerializeHelper.ToXml(query);
		}

		public static explicit operator VShippingInfoQuery(string query)
		{
			return (VShippingInfoQuery)VShippingInfoQuery.SerializeHelper.FromXml(query, typeof(VShippingInfoQuery));
		}
		
		#endregion		
	}

	[DataContract]
	[Serializable]
	abstract public partial class esVShippingInfo : esEntity
	{
		public esVShippingInfo()
		{

		}
		
		#region LoadByPrimaryKey
		
		#endregion
		
		#region Properties
		
		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ShipID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? ShipID
		{
			get
			{
				return base.GetSystemDecimal(VShippingInfoMetadata.ColumnNames.ShipID);
			}
			
			set
			{
				if(base.SetSystemDecimal(VShippingInfoMetadata.ColumnNames.ShipID, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ShipID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.SupplierBoxNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String SupplierBoxNo
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.SupplierBoxNo);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.SupplierBoxNo, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.SupplierBoxNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.FromDestination
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? FromDestination
		{
			get
			{
				return base.GetSystemDecimal(VShippingInfoMetadata.ColumnNames.FromDestination);
			}
			
			set
			{
				if(base.SetSystemDecimal(VShippingInfoMetadata.ColumnNames.FromDestination, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.FromDestination);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ToDestination
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? ToDestination
		{
			get
			{
				return base.GetSystemDecimal(VShippingInfoMetadata.ColumnNames.ToDestination);
			}
			
			set
			{
				if(base.SetSystemDecimal(VShippingInfoMetadata.ColumnNames.ToDestination, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ToDestination);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ReceivedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ReceivedBy
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.ReceivedBy);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.ReceivedBy, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ReceivedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ReceivedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ReceivedDttm
		{
			get
			{
				return base.GetSystemDateTime(VShippingInfoMetadata.ColumnNames.ReceivedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(VShippingInfoMetadata.ColumnNames.ReceivedDttm, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ReceivedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.Sender
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Sender
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.Sender);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.Sender, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.Sender);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ShippingDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ShippingDate
		{
			get
			{
				return base.GetSystemDateTime(VShippingInfoMetadata.ColumnNames.ShippingDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(VShippingInfoMetadata.ColumnNames.ShippingDate, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ShippingDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.AttachmentName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String AttachmentName
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.AttachmentName);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.AttachmentName, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.AttachmentName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ShippingStatus
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ShippingStatus
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.ShippingStatus);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.ShippingStatus, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ShippingStatus);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.Comments
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Comments
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.Comments);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.Comments, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.Comments);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.CreatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CreatedBy
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.CreatedBy);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.CreatedBy, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.CreatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.CreatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CreatedDttm
		{
			get
			{
				return base.GetSystemDateTime(VShippingInfoMetadata.ColumnNames.CreatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(VShippingInfoMetadata.ColumnNames.CreatedDttm, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.CreatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.UpdatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String UpdatedBy
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.UpdatedBy);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.UpdatedBy, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.UpdatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.UpdatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? UpdatedDttm
		{
			get
			{
				return base.GetSystemDateTime(VShippingInfoMetadata.ColumnNames.UpdatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(VShippingInfoMetadata.ColumnNames.UpdatedDttm, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.UpdatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.FromDestinationName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String FromDestinationName
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.FromDestinationName);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.FromDestinationName, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.FromDestinationName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ToDestinationName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ToDestinationName
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.ToDestinationName);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.ToDestinationName, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ToDestinationName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.ShippingStatusName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ShippingStatusName
		{
			get
			{
				return base.GetSystemString(VShippingInfoMetadata.ColumnNames.ShippingStatusName);
			}
			
			set
			{
				if(base.SetSystemString(VShippingInfoMetadata.ColumnNames.ShippingStatusName, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ShippingStatusName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_ShippingInfo.BoxCount
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? BoxCount
		{
			get
			{
				return base.GetSystemInt32(VShippingInfoMetadata.ColumnNames.BoxCount);
			}
			
			set
			{
				if(base.SetSystemInt32(VShippingInfoMetadata.ColumnNames.BoxCount, value))
				{
					OnPropertyChanged(VShippingInfoMetadata.PropertyNames.BoxCount);
				}
			}
		}		
		
		#endregion	

		#region .str() Properties
		
		public override void SetProperties(IDictionary values)
		{
			foreach (string propertyName in values.Keys)
			{
				this.SetProperty(propertyName, values[propertyName]);
			}
		}
		
		public override void SetProperty(string name, object value)
		{
			esColumnMetadata col = this.Meta.Columns.FindByPropertyName(name);
			if (col != null)
			{
				if(value == null || value is System.String)
				{				
					// Use the strongly typed property
					switch (name)
					{							
						case "ShipID": this.str().ShipID = (string)value; break;							
						case "SupplierBoxNo": this.str().SupplierBoxNo = (string)value; break;							
						case "FromDestination": this.str().FromDestination = (string)value; break;							
						case "ToDestination": this.str().ToDestination = (string)value; break;							
						case "ReceivedBy": this.str().ReceivedBy = (string)value; break;							
						case "ReceivedDttm": this.str().ReceivedDttm = (string)value; break;							
						case "Sender": this.str().Sender = (string)value; break;							
						case "ShippingDate": this.str().ShippingDate = (string)value; break;							
						case "AttachmentName": this.str().AttachmentName = (string)value; break;							
						case "ShippingStatus": this.str().ShippingStatus = (string)value; break;							
						case "Comments": this.str().Comments = (string)value; break;							
						case "CreatedBy": this.str().CreatedBy = (string)value; break;							
						case "CreatedDttm": this.str().CreatedDttm = (string)value; break;							
						case "UpdatedBy": this.str().UpdatedBy = (string)value; break;							
						case "UpdatedDttm": this.str().UpdatedDttm = (string)value; break;							
						case "FromDestinationName": this.str().FromDestinationName = (string)value; break;							
						case "ToDestinationName": this.str().ToDestinationName = (string)value; break;							
						case "ShippingStatusName": this.str().ShippingStatusName = (string)value; break;							
						case "BoxCount": this.str().BoxCount = (string)value; break;
					}
				}
				else
				{
					switch (name)
					{	
						case "ShipID":
						
							if (value == null || value is System.Decimal)
								this.ShipID = (System.Decimal?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ShipID);
							break;
						
						case "FromDestination":
						
							if (value == null || value is System.Decimal)
								this.FromDestination = (System.Decimal?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.FromDestination);
							break;
						
						case "ToDestination":
						
							if (value == null || value is System.Decimal)
								this.ToDestination = (System.Decimal?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ToDestination);
							break;
						
						case "ReceivedDttm":
						
							if (value == null || value is System.DateTime)
								this.ReceivedDttm = (System.DateTime?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ReceivedDttm);
							break;
						
						case "ShippingDate":
						
							if (value == null || value is System.DateTime)
								this.ShippingDate = (System.DateTime?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.ShippingDate);
							break;
						
						case "CreatedDttm":
						
							if (value == null || value is System.DateTime)
								this.CreatedDttm = (System.DateTime?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.CreatedDttm);
							break;
						
						case "UpdatedDttm":
						
							if (value == null || value is System.DateTime)
								this.UpdatedDttm = (System.DateTime?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.UpdatedDttm);
							break;
						
						case "BoxCount":
						
							if (value == null || value is System.Int32)
								this.BoxCount = (System.Int32?)value;
								OnPropertyChanged(VShippingInfoMetadata.PropertyNames.BoxCount);
							break;
					

						default:
							break;
					}
				}
			}
            else if (this.ContainsColumn(name))
            {
                this.SetColumn(name, value);
            }
			else
			{
				throw new Exception("SetProperty Error: '" + name + "' not found");
			}
		}		

		public esStrings str()
		{
			if (esstrings == null)
			{
				esstrings = new esStrings(this);
			}
			return esstrings;
		}

		sealed public class esStrings
		{
			public esStrings(esVShippingInfo entity)
			{
				this.entity = entity;
			}
			
	
			public System.String ShipID
			{
				get
				{
					System.Decimal? data = entity.ShipID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShipID = null;
					else entity.ShipID = Convert.ToDecimal(value);
				}
			}
				
			public System.String SupplierBoxNo
			{
				get
				{
					System.String data = entity.SupplierBoxNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.SupplierBoxNo = null;
					else entity.SupplierBoxNo = Convert.ToString(value);
				}
			}
				
			public System.String FromDestination
			{
				get
				{
					System.Decimal? data = entity.FromDestination;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FromDestination = null;
					else entity.FromDestination = Convert.ToDecimal(value);
				}
			}
				
			public System.String ToDestination
			{
				get
				{
					System.Decimal? data = entity.ToDestination;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ToDestination = null;
					else entity.ToDestination = Convert.ToDecimal(value);
				}
			}
				
			public System.String ReceivedBy
			{
				get
				{
					System.String data = entity.ReceivedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReceivedBy = null;
					else entity.ReceivedBy = Convert.ToString(value);
				}
			}
				
			public System.String ReceivedDttm
			{
				get
				{
					System.DateTime? data = entity.ReceivedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReceivedDttm = null;
					else entity.ReceivedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String Sender
			{
				get
				{
					System.String data = entity.Sender;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Sender = null;
					else entity.Sender = Convert.ToString(value);
				}
			}
				
			public System.String ShippingDate
			{
				get
				{
					System.DateTime? data = entity.ShippingDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShippingDate = null;
					else entity.ShippingDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String AttachmentName
			{
				get
				{
					System.String data = entity.AttachmentName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.AttachmentName = null;
					else entity.AttachmentName = Convert.ToString(value);
				}
			}
				
			public System.String ShippingStatus
			{
				get
				{
					System.String data = entity.ShippingStatus;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShippingStatus = null;
					else entity.ShippingStatus = Convert.ToString(value);
				}
			}
				
			public System.String Comments
			{
				get
				{
					System.String data = entity.Comments;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Comments = null;
					else entity.Comments = Convert.ToString(value);
				}
			}
				
			public System.String CreatedBy
			{
				get
				{
					System.String data = entity.CreatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedBy = null;
					else entity.CreatedBy = Convert.ToString(value);
				}
			}
				
			public System.String CreatedDttm
			{
				get
				{
					System.DateTime? data = entity.CreatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedDttm = null;
					else entity.CreatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String UpdatedBy
			{
				get
				{
					System.String data = entity.UpdatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedBy = null;
					else entity.UpdatedBy = Convert.ToString(value);
				}
			}
				
			public System.String UpdatedDttm
			{
				get
				{
					System.DateTime? data = entity.UpdatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedDttm = null;
					else entity.UpdatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String FromDestinationName
			{
				get
				{
					System.String data = entity.FromDestinationName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FromDestinationName = null;
					else entity.FromDestinationName = Convert.ToString(value);
				}
			}
				
			public System.String ToDestinationName
			{
				get
				{
					System.String data = entity.ToDestinationName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ToDestinationName = null;
					else entity.ToDestinationName = Convert.ToString(value);
				}
			}
				
			public System.String ShippingStatusName
			{
				get
				{
					System.String data = entity.ShippingStatusName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShippingStatusName = null;
					else entity.ShippingStatusName = Convert.ToString(value);
				}
			}
				
			public System.String BoxCount
			{
				get
				{
					System.Int32? data = entity.BoxCount;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxCount = null;
					else entity.BoxCount = Convert.ToInt32(value);
				}
			}
			

			private esVShippingInfo entity;
		}
		
		[NonSerialized]
		private esStrings esstrings;		
		
		#endregion
		
		#region Housekeeping methods

		override protected IMetadata Meta
		{
			get
			{
				return VShippingInfoMetadata.Meta();
			}
		}

		#endregion		
		
		#region Query Logic

		public VShippingInfoQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new VShippingInfoQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(VShippingInfoQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return this.Query.Load();
		}
		
		protected void InitQuery(VShippingInfoQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntity)this).Connection;
			}			
		}

		#endregion
		
        [IgnoreDataMember]
		private VShippingInfoQuery query;		
	}



	[Serializable]
	abstract public partial class esVShippingInfoCollection : esEntityCollection<VShippingInfo>
	{
		#region Housekeeping methods
		override protected IMetadata Meta
		{
			get
			{
				return VShippingInfoMetadata.Meta();
			}
		}

		protected override string GetCollectionName()
		{
			return "VShippingInfoCollection";
		}

		#endregion		
		
		#region Query Logic

	#if (!WindowsCE)
		[BrowsableAttribute(false)]
	#endif
		public VShippingInfoQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new VShippingInfoQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(VShippingInfoQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return Query.Load();
		}

		override protected esDynamicQuery GetDynamicQuery()
		{
			if (this.query == null)
			{
				this.query = new VShippingInfoQuery();
				this.InitQuery(query);
			}
			return this.query;
		}

		protected void InitQuery(VShippingInfoQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntityCollection)this).Connection;
			}			
		}

		protected override void HookupQuery(esDynamicQuery query)
		{
			this.InitQuery((VShippingInfoQuery)query);
		}

		#endregion
		
		private VShippingInfoQuery query;
	}



	[Serializable]
	abstract public partial class esVShippingInfoQuery : esDynamicQuery
	{
		override protected IMetadata Meta
		{
			get
			{
				return VShippingInfoMetadata.Meta();
			}
		}	
		
		#region QueryItemFromName
		
        protected override esQueryItem QueryItemFromName(string name)
        {
            switch (name)
            {
				case "ShipID": return this.ShipID;
				case "SupplierBoxNo": return this.SupplierBoxNo;
				case "FromDestination": return this.FromDestination;
				case "ToDestination": return this.ToDestination;
				case "ReceivedBy": return this.ReceivedBy;
				case "ReceivedDttm": return this.ReceivedDttm;
				case "Sender": return this.Sender;
				case "ShippingDate": return this.ShippingDate;
				case "AttachmentName": return this.AttachmentName;
				case "ShippingStatus": return this.ShippingStatus;
				case "Comments": return this.Comments;
				case "CreatedBy": return this.CreatedBy;
				case "CreatedDttm": return this.CreatedDttm;
				case "UpdatedBy": return this.UpdatedBy;
				case "UpdatedDttm": return this.UpdatedDttm;
				case "FromDestinationName": return this.FromDestinationName;
				case "ToDestinationName": return this.ToDestinationName;
				case "ShippingStatusName": return this.ShippingStatusName;
				case "BoxCount": return this.BoxCount;

                default: return null;
            }
        }		
		
		#endregion
		
		#region esQueryItems

		public esQueryItem ShipID
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ShipID, esSystemType.Decimal); }
		} 
		
		public esQueryItem SupplierBoxNo
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.SupplierBoxNo, esSystemType.String); }
		} 
		
		public esQueryItem FromDestination
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.FromDestination, esSystemType.Decimal); }
		} 
		
		public esQueryItem ToDestination
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ToDestination, esSystemType.Decimal); }
		} 
		
		public esQueryItem ReceivedBy
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ReceivedBy, esSystemType.String); }
		} 
		
		public esQueryItem ReceivedDttm
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ReceivedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem Sender
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.Sender, esSystemType.String); }
		} 
		
		public esQueryItem ShippingDate
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ShippingDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem AttachmentName
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.AttachmentName, esSystemType.String); }
		} 
		
		public esQueryItem ShippingStatus
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ShippingStatus, esSystemType.String); }
		} 
		
		public esQueryItem Comments
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.Comments, esSystemType.String); }
		} 
		
		public esQueryItem CreatedBy
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.CreatedBy, esSystemType.String); }
		} 
		
		public esQueryItem CreatedDttm
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.CreatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem UpdatedBy
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.UpdatedBy, esSystemType.String); }
		} 
		
		public esQueryItem UpdatedDttm
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.UpdatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem FromDestinationName
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.FromDestinationName, esSystemType.String); }
		} 
		
		public esQueryItem ToDestinationName
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ToDestinationName, esSystemType.String); }
		} 
		
		public esQueryItem ShippingStatusName
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.ShippingStatusName, esSystemType.String); }
		} 
		
		public esQueryItem BoxCount
		{
			get { return new esQueryItem(this, VShippingInfoMetadata.ColumnNames.BoxCount, esSystemType.Int32); }
		} 
		
		#endregion
		
	}



	[Serializable]
	public partial class VShippingInfoMetadata : esMetadata, IMetadata
	{
		#region Protected Constructor
		protected VShippingInfoMetadata()
		{
			m_columns = new esColumnMetadataCollection();
			esColumnMetadata c;

			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ShipID, 0, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ShipID;
			c.NumericPrecision = 18;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.SupplierBoxNo, 1, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.SupplierBoxNo;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.FromDestination, 2, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.FromDestination;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ToDestination, 3, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ToDestination;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ReceivedBy, 4, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ReceivedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ReceivedDttm, 5, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ReceivedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.Sender, 6, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.Sender;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ShippingDate, 7, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ShippingDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.AttachmentName, 8, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.AttachmentName;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ShippingStatus, 9, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ShippingStatus;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.Comments, 10, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.Comments;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.CreatedBy, 11, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.CreatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.CreatedDttm, 12, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.CreatedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.UpdatedBy, 13, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.UpdatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.UpdatedDttm, 14, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.UpdatedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.FromDestinationName, 15, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.FromDestinationName;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ToDestinationName, 16, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ToDestinationName;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.ShippingStatusName, 17, typeof(System.String), esSystemType.String);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.ShippingStatusName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VShippingInfoMetadata.ColumnNames.BoxCount, 18, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VShippingInfoMetadata.PropertyNames.BoxCount;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
		}
		#endregion	
	
		static public VShippingInfoMetadata Meta()
		{
			return meta;
		}	
		
		public Guid DataID
		{
			get { return base.m_dataID; }
		}	
		
		public bool MultiProviderMode
		{
			get { return false; }
		}		

		public esColumnMetadataCollection Columns
		{
			get	{ return base.m_columns; }
		}
		
		#region ColumnNames
		public class ColumnNames
		{ 
			 public const string ShipID = "ShipID";
			 public const string SupplierBoxNo = "SupplierBoxNo";
			 public const string FromDestination = "FromDestination";
			 public const string ToDestination = "ToDestination";
			 public const string ReceivedBy = "ReceivedBy";
			 public const string ReceivedDttm = "ReceivedDttm";
			 public const string Sender = "Sender";
			 public const string ShippingDate = "ShippingDate";
			 public const string AttachmentName = "AttachmentName";
			 public const string ShippingStatus = "ShippingStatus";
			 public const string Comments = "Comments";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string FromDestinationName = "FromDestinationName";
			 public const string ToDestinationName = "ToDestinationName";
			 public const string ShippingStatusName = "ShippingStatusName";
			 public const string BoxCount = "BoxCount";
		}
		#endregion	
		
		#region PropertyNames
		public class PropertyNames
		{ 
			 public const string ShipID = "ShipID";
			 public const string SupplierBoxNo = "SupplierBoxNo";
			 public const string FromDestination = "FromDestination";
			 public const string ToDestination = "ToDestination";
			 public const string ReceivedBy = "ReceivedBy";
			 public const string ReceivedDttm = "ReceivedDttm";
			 public const string Sender = "Sender";
			 public const string ShippingDate = "ShippingDate";
			 public const string AttachmentName = "AttachmentName";
			 public const string ShippingStatus = "ShippingStatus";
			 public const string Comments = "Comments";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string FromDestinationName = "FromDestinationName";
			 public const string ToDestinationName = "ToDestinationName";
			 public const string ShippingStatusName = "ShippingStatusName";
			 public const string BoxCount = "BoxCount";
		}
		#endregion	

		public esProviderSpecificMetadata GetProviderMetadata(string mapName)
		{
			MapToMeta mapMethod = mapDelegates[mapName];

			if (mapMethod != null)
				return mapMethod(mapName);
			else
				return null;
		}
		
		#region MAP esDefault
		
		static private int RegisterDelegateesDefault()
		{
			// This is only executed once per the life of the application
			lock (typeof(VShippingInfoMetadata))
			{
				if(VShippingInfoMetadata.mapDelegates == null)
				{
					VShippingInfoMetadata.mapDelegates = new Dictionary<string,MapToMeta>();
				}
				
				if (VShippingInfoMetadata.meta == null)
				{
					VShippingInfoMetadata.meta = new VShippingInfoMetadata();
				}
				
				MapToMeta mapMethod = new MapToMeta(meta.esDefault);
				mapDelegates.Add("esDefault", mapMethod);
				mapMethod("esDefault");
			}
			return 0;
		}			

		private esProviderSpecificMetadata esDefault(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();			


				meta.AddTypeMap("ShipID", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("SupplierBoxNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("FromDestination", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("ToDestination", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("ReceivedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ReceivedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("Sender", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ShippingDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("AttachmentName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ShippingStatus", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Comments", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("UpdatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("UpdatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("FromDestinationName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ToDestinationName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ShippingStatusName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("BoxCount", new esTypeMap("int", "System.Int32"));			
				
				
				
				meta.Source = "V_ShippingInfo";
				meta.Destination = "V_ShippingInfo";
				
				meta.spInsert = "proc_V_ShippingInfoInsert";				
				meta.spUpdate = "proc_V_ShippingInfoUpdate";		
				meta.spDelete = "proc_V_ShippingInfoDelete";
				meta.spLoadAll = "proc_V_ShippingInfoLoadAll";
				meta.spLoadByPrimaryKey = "proc_V_ShippingInfoLoadByPrimaryKey";
				
				this.m_providerMetadataMaps["esDefault"] = meta;
			}
			
			return this.m_providerMetadataMaps["esDefault"];
		}

		#endregion

		static private VShippingInfoMetadata meta;
		static protected Dictionary<string, MapToMeta> mapDelegates;
		static private int _esDefault = RegisterDelegateesDefault();
	}
}
